package com.example.yiqiuser.service.impl;


import com.example.yiqiuser.dao.NeChannelDao;
import com.example.yiqiuser.entity.NeChannel;
import com.example.yiqiuser.service.NeChannelService;
import com.example.yiqiuser.util.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author: Jyc
 * @classname: NeChannlServiceImpl
 * @date: 2023/4/1
 * @time: 9:50
 * @description:
 */
@Service
public class NeChannelServiceImpl implements NeChannelService {
    @Resource
    private NeChannelDao neChannelDao;


    @Override
    public PageInfo queryByParams(Page<NeChannel> page) {
        PageHelper.startPage(page.getPageNo(),page.getPageSize());
        return new PageInfo<>(neChannelDao.queryByParams(page.getData()));
    }

    @Override
    public NeChannel queryById(int id) {
        return neChannelDao.queryById(id);
    }

    @Override
    public int adds(NeChannel neChannel) {
        return neChannelDao.adds(neChannel);
    }

    @Override
    public int delete(int id) {
        return neChannelDao.delete(id);
    }

    @Override
    public int update(NeChannel neChannel) {
        return neChannelDao.update(neChannel);
    }
}
